package com.tour.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tour.entity.Post;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lel
 * @since 2020-12-30
 */
@Mapper
@Repository
public interface PostMapper extends BaseMapper<Post> {

    Page<Map> findPostByCategory(IPage<Map> page, @Param("category") String category);

    Page<Map> findPostByuserId(IPage<Map> page,@Param("userId") Integer userId);

    Map findPostById(@Param("postId") Integer postId);

    Page<Map> seachPost(IPage<Map> page,@Param("content") String content);
}
